/**
 * Created by Administrator on 2016/3/24.
 */

;
(function ($) {

    $.extend({
        _timer: {},
        delay_till_last: function (id, fn, wait) {
            var _this = this;
            if (!_this._timer[id]) {
                window.clearTimeout(_timer[id]);
                delete _this._timer[id];
                fn();
            }

            return _this._timer[id] = window.setTimeout(function () {
                delete _this._timer[id];
            }, wait);
        }
    });

})(jQuery);
